package com.shycloud.mido.opter.api.feign;

import com.shycloud.mido.common.core.constant.ServiceNameConstants;
import com.shycloud.mido.common.core.util.R;
import com.shycloud.mido.opter.api.entity.OptOperator;
import com.shycloud.mido.opter.api.entity.OrgSettledCount;
import com.shycloud.mido.opter.api.entity.StockSaleOrder;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * 运营商逻辑 feign
 *
 * @author nianhua.jiang
 * @date 2021/6/16 15:44
 */
@FeignClient(value = ServiceNameConstants.OPTER_SERVICE)
public interface RemoteOptService {

	/**
	 * 查看硬件信息
	 *
	 * @param udid 硬件ID/设备码
	 * @return com.shycloud.mido.common.core.util.R
	 * @author nianhua.jiang
	 * @date 2021/6/16 15:46
	 */
	@RequestMapping(method = RequestMethod.GET, value = "/udid/getUdidDetail")
	R getUdidDetail(@RequestParam("udid") String udid);

	@RequestMapping(method = RequestMethod.GET, value = "/new_manage/getDetailByLocation")
	R<List<OptOperator>> getDetailByLocation(@RequestParam("province") String province, @RequestParam("city") String city);

	@RequestMapping(method = RequestMethod.POST, value = "/stock/addSaleOrderFeign")
	R<Boolean> addStockSaleOrder(@RequestBody StockSaleOrder saleOrder);

	@RequestMapping(method = RequestMethod.POST, value = "/stock/saveSaleOrderFeign")
	R<Boolean> updateStockSaleOrder(@RequestBody StockSaleOrder saleOrder);

	@RequestMapping(method = RequestMethod.POST, value = "/new_manage/settledOrder")
	R<Boolean> settledOrder(@RequestBody OrgSettledCount orgSettledCount);

	@RequestMapping(method = RequestMethod.GET, value = "/new_manage/getOptById")
	R<OptOperator> getOptById(@RequestParam("optId") Integer optId);
}
